<div class="form__wrapper">
  <div class="card pt-4">
    <div class="card-section">
      <div class="row column pb-4">
        <%= form.translated :text_field, :title, autofocus: true, aria: { label: :title }, data: { controller: "character-counter" } %>
      </div>
      <div class="row column">
        <%= form.translated :editor, :body, resource_mentionable: true, aria: { label: :body } %>
      </div>
      <% if @form.meetings %>
        <div class="meeting-fields">
          <div class="row column">
            <%= form.check_box :created_in_meeting, label: t(".created_in_meeting") %>
          </div>
          <div class="row column" id="proposal_meeting">
            <%= form.select :meeting_id,
                            options_for_select(@form.meetings&.map { |meeting| [present(meeting).title(html_escape: true), meeting.id] }, selected: meetings_as_authors_selected ),
                            { include_blank: true, label: t(".select_a_meeting") },
                            { multiple: false, class: "chosen-select" } %>
          </div>
        </div>
      <% end %>
      <% if @form.geocoding_enabled? %>
        <div class="row column">
          <%= form.geocoding_field :address %>
        </div>
      <% end %>

      <% if @form.taxonomy_filters&.any? %>
        <% @form.taxonomy_filters.each do |filter| %>
          <div class="row column">
            <%= filter_taxonomy_items_select_field form, :taxonomies, filter %>
          </div>
        <% end %>
      <% end %>

      <% if component_settings.attachments_allowed? %>
        <div class="row column">
          <%= form.attachment :documents,
                              multiple: true,
                              label: t("decidim.proposals.proposals.edit.add_attachments"),
                              button_label: t("decidim.proposals.proposals.edit.add_attachments"),
                              button_edit_label: t("decidim.proposals.proposals.edit.edit_attachments"),
                              button_class: "button button__sm button__transparent-secondary mt-2 md:w-auto w-full",
                              help_i18n_scope: "decidim.forms.file_help.file",
                              help_text: t("attachment_legend", scope: "decidim.proposals.proposals.edit") %>
        </div>
      <% end %>
    </div>
  </div>
</div>
<%= append_javascript_pack_tag "decidim_proposals_admin" %>
